package com.lagou.stage1.model4.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.lagou.stage1.model4.mapper.ArticleMapper;
import com.lagou.stage1.model4.pojo.Article;
import com.lagou.stage1.model4.service.IArticleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 文章业务实现类
 * @author 陶肖寅
 * @version V1.0
 * @Package com.lagou.stage1.model4.service.impl
 * @date 2020-02-19 17:19
 * @Copyright © 2020-2021 城云科技(中国)有限公司
 */
@Service
public class ArticleService implements IArticleService {
    @Autowired
    private ArticleMapper articleMapper;
    @Override
    public PageInfo<Article> getArticlePaged(Integer pageNum, Integer pageSize) {
        PageHelper.startPage(pageNum,pageSize);
        List<Article> articleList = articleMapper.findArticleList();
        PageInfo pageInfo = new PageInfo(articleList);
        return pageInfo;
    }
}
